/*
 TPPMC:
 Transversely Polarised Proton Monte Carlo
 
 based on
 
 TOYMC:
 Toy Monte Carlo Generator for asymmetry studies
 J. Lajoie 
 lajoie@iastate.edu
*/

/*
 Questions:
 \remark What are the 200 different Sivers sets?
 */

#include <iostream>

#include <TROOT.h>
#include <TRandom.h>

#include "tppmc/Application.h"
#include "tppmc/Configuration.h"
#include "tppmc/Pythia6.h"

/**
 */
int main(int argc, char* argv[]) {
   try {
      // Initialise the ROOT environment
      TROOT root("tppmc", "");
      // Set the ROOT random seed (global) to a unique value
      gRandom->SetSeed(0);
      // Process the arguments passed to the programme
      tppmc::Configuration config(argc, argv);
      // Initialise PYTHIA 6, referring to input arguments
      tppmc::Pythia6 pythia(config);
      // Initialise the application, referring to input arguments
      tppmc::Application app(config);
      // Loop over the number of events specified by the Configuration
      app.EventLoop(0);
      // Done, write output
      app.Close();
      return 0;
   } // try
   catch(std::exception& e) {
      std::cerr << "Caught exception: " << e.what() << std::endl;
      return 1;
   } // catch
}
